<%@ page contentType="text/html;charset=UTF-8" isErrorPage="true" %>
<%@ page import="org.apache.commons.logging.LogFactory" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>出点儿小错...</title>
	
	<script language="javascript">
		function showDetail(){
			var errorMsgNode = document.getElementById('detail_error_msg');
			if(errorMsgNode.style.display == ""){
				errorMsgNode.style.display = "none";
			}else{
				errorMsgNode.style.display = "";
			}
		}
	</script>
</head>

<body>
	<%
		//Exception from JSP didn't log yet ,should log it here.
		String requestUri = (String) request.getAttribute("javax.servlet.error.request_uri");
		LogFactory.getLog(requestUri).error(exception.getMessage(), exception);
	%>

	<div class="error_page">
		<h1>很抱歉...</h1>
		<p>你访问的页面出现了错误。<a href="<c:url value="/"/>">返回首页</a></p>

		<p><a href="javascript:showDetail()">您可以点击这里，将错误消息反馈给我们</a></p>
		<div id="detail_error_msg" style="display:none">
			<pre><%exception.printStackTrace(new java.io.PrintWriter(out));%></pre>
		</div>
	</div>
</body>
</html>